/*******************************************************************************
 * Firecall_AddDB.sql
 *
 */
SET IMPLICIT_TRANSACTIONS OFF
GO
DECLARE @CMRNum VARCHAR(16); SET @CMRNum= ''			-- <== REMEMBER THE CMR NUMBER !!!
IF @CMRNum = '' PRINT 'PLEASE PROVIDE THE CMR NUMBER !!!'
ELSE BEGIN
	DECLARE @Login SYSNAME; SET @Login= 'SQLfirecall' + RIGHT(@CMRNum, 6)
	EXECUTE sp_grantdbaccess @Login
	EXECUTE sp_addrolemember 'db_datareader', @login
	EXECUTE sp_addrolemember 'db_datawriter', @login
	PRINT 'Database:	[' + @@SERVERNAME+'].['+DB_Name()+']'
END
GO